var arr = [1,2,3,4,5]
function Arr(arr) {
	if(arr == null) return;
	for(var i = 0; i < arr.length; i++){
		console.log(arr[i])
	}
}

Arr(arr);

console.log('-----------------')


function Node(value) {
	this.value = value;
	this.next = null
}
var node1 = new Node(1);
var node2 = new Node(2);
var node3 = new Node(3);
var node4 = new Node(4);
var node5 = new Node(5);
node1.next = node2;
node2.next = node3;
node3.next = node4;
node4.next = node5;


function Link(root) {
	var temp = root;
	while(true) {                    //链表不知道长度用 while
		if(temp !== null){           //链表不为空 打印
			console.log(temp.value)
		} else {                     //链表为空 跳出循环
			break;
		}
		temp = temp.next;            //
	}
}

Link(node1)
